home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 1 #1
/
utv1n1s2.d64
/
video phile
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2022-08-28
|
20KB
|
662 lines
1 rem video phile v12
2 rem video tape library database with indices
3 rem by michael reich 9/07/86
4 rem using relative file - use 'create' program to start rel.file
5 rem *******************
10 poke53280,0:poke53281,0:c1$=chr$(5) :c2$=chr$(152)
15 uptime=(8*4096)+4
20 print"[147]"chr$(142)chr$(8)
25 sp$=" ":rem len 37
30 nf=10:n=100:rem # fields and records- also see line 20020
40 dim temp$(nf),kk$(nf),s(nf),l(nf),rc$(4),ia$(n),ib$(n),ic$(n),k$(n)
50 nr=0: ls$="[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
52 lp$="*******************"
55 dim q1$(n),m%(n),s%(20):rem *** used in sort ***
60 fori=1tonf:readf$(i),s(i),l(i):next
70 data title,1,20,star,21,20,co-star,41,20
80 data start,61,4,end,65,4,speed,69,2,time,71,3,year,74,4,type,78,5
90 data tape #,83,3
170 gosub 8000: gosub 9800
175 gosub 200: goto 800
180 poke781,x:poke782,0:goto195: rem line select
185 poke781,21:poke782,0:goto195
190 poke781,peek(214):poke782,y: rem tab
195 poke783,0:sys65520:return
196 rem *********
197 rem read index
198 rem *********
199 :
200 gosub470: rem *** init disk ***
205 nr=0: if mo=4 then print sc$
210 open 2,8,2,"0:video.index,s,r": i=0
220 gosub 400: rem *** ck disk error ***
225 if er=0 then 250
230 gosub640: rem *** close on no index ***
235 return
250 x=17: gosub 180: print"[150] reading index[157][157][157][157][157][157][157][157][157][157][157][157][157]";
252 input#2,nr
255 for i=1 to nr: input#2,ia$(i): next
260 for i=1 to nr: input#2,ib$(i): next
270 for i=1 to nr: input#2,ic$(i): next
340 gosub 460
350 gosub 370: print" ": return
370 in=150
380 t=ti+in
385 if ti<t then goto 385
390 return
400 :
402 rem disk utilities
404 :
410 er=0:input#15,er,er$
420 return
430 close2:ifer>0thenprinter,er$
440 return
450 close15:return
460 gosub430:gosub450:return: rem close all files
470 open15,8,15,"i0":return
500 rem *********
502 rem write index
504 rem *********
510 ifnr<1thenprint"no records in file to save":gosub370:gosub370:goto800
520 gosub470:rem open command channel
530 gosub185:print"scratching old index" :print#15,"s0:video.index"
560 open2,8,2,"0:video.index,s,w": gosub400:ifer=0thengoto570
565 gosub430:gosub450:stop
570 gosub22300:gosub185:print"writing index":print#2,nr
580 fori=1tonr:print#2,ia$(i):next: fori=1tonr:print#2,ib$(i):next
590 fori=1tonr:print#2,ic$(i):next
600 gosub460:return
620 printtab(14)"[145] [150] invalid [157][157][157][157][157][157][157][157][157][157][157][146]";: gosub 370: return
630 :
636 rem *****************
637 rem close on no index
638 rem *****************
639 :
640 close 2: close 15
650 em$="no index on disk"
660 if er<>62 then em$="disk unusable"
670 x=17: gosub 180
680 print em$
690 return
796 rem *********
797 rem menu
798 rem *********
799 :
800 x=6: gosub 180
805 print"[150]>> main menu [150]<<": print
810 print "[150] 1[150]- display"
820 print "[150] 2[150]- edit"
830 print "[150] 3[150]- add to file"
840 print "[150] 4[150]- printer"
845 print "[150] options"
850 print "[150] 5[150]- create file": print
860 print "[150] f8[150]- uptime"
865 x=21: gosub 180
870 print "[153] there are ";nr;"[157][153] records available."
875 print" "
880 get k$: if k$="" then 880
882 if k$=chr$(140) then sys uptime
884 k=val(k$): if (k<1) or (k>5) then 880
886 mo=k
890 on mo gosub 2000,5000,4000,7000,20000
895 goto800
935 rem screen displays using c-64 graphics chars.
940 y=21: n$=" rambo ": r$="[146]": d$="": gosub 8500
945 for x=1tozz: next
950 y=23: n$="star wars": r$="": d$="": gosub 8500
955 for x=1tozz: next
960 y=25: n$=" top gun ": r$="[146]": d$="": gosub 8500
970 return
1000 rem *********
1002 rem sort indices
1004 rem *********
1008 :
1009 ti$="000000":ifnr<2thenreturn
1010 rem ia$ array
1015 ifmo=2thenifp1=0thengoto1100
1020 forq=1tonr:q1$(q)=ia$(q):next: so=1:gosub55000
1030 forq=1tonr:ia$(q)=q1$(q):next
1100 :
1110 rem ib$ array
1115 ifmo=2thenifp2=0thengoto1200
1120 forq=1tonr:q1$(q)=ib$(q):next: so=2:gosub55000
1130 forq=1tonr:ib$(q)=q1$(q):next
1200 :
1210 rem ic$ array
1215 ifmo=2thenifp3=0thengoto1300
1220 forq=1tonr:q1$(q)=ic$(q):next: so=1:gosub55000
1230 forq=1tonr:ic$(q)=q1$(q):next
1300 return
1750 :
1770 gosub1790:printc1$mid$(ti$,4,1);":";right$(ti$,2):return
1780 gosub1790:printc2$mid$(ti$,4,1);":";right$(ti$,2)c1$:return
1790 gosub185:print"sorting index...wait ";:return
1996 rem *********
1997 rem display
1998 rem *********
1999 :
2000 if nr<>0 then 2010
2002 x=21: gosub 180: print"[153] no records to display! [153] "
2004 for x=1to 1750: next
2006 return
2010 w=0: print"[147]": gosub 2620: y=11
2020 print: print "select by: [150]s[146][158]tar": gosub 190: print "[150]m[146][158]ovie title"
2030 gosub 190: print "[150]t[146][158]ape #": gosub 190: print "[150]r[146][158]ecord #"
2035 gosub 190: print "[150]q[146][158]uit": print
2040 x=16:gosub180
2045 print "[155] <<- enter choice ->>[146]"
2050 get s$: if s$="" then 2050
2054 t$="name record #"
2055 if s$="q" then gosub 8000: return
2060 if s$="s" then print"[147]": gosub 2330: goto 2200
2070 if s$="m" then print"[147]": gosub 2100: goto 2200
2080 if s$="t" then print"[147]": gosub 2430: goto 2200
2082 if s$<>"r" then 2050
2084 gosub 2700: rem *** get record # ***
2085 if (s>0) and (s<=nr) then ch=s: goto 2235
2086 print"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157] ": goto 2050
2090 x=16: gosub180: print " [150] invalid [146] "
2095 gosub 370: goto 2040
2100 t$="title record #": gosub 2600
2110 w=1: print"[158]";: for i=1 to nr: print left$(ia$(i),20)" "mid$(ia$(i),21)
2115 gosub6600:next:poke198,0:return
2200 printspc(8)"[155]enter rec. # to display"
2210 print:printspc(12)"[155]or <cr> to exit[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";: k=0: ex=0
2220 gosub 9500: rem *** get rec # from kbd ***
2225 if ex=1 then gosub 8000: return
2230 ch=val(t$)
2235 gosub 3000
2240 goto2000
2330 printsc$:gosub2600
2340 w=1: print"[158]";: fori=1tonr:printleft$(ib$(i),20)" "mid$(ib$(i),21)
2345 gosub6600:next:poke198,0:return
2430 t$="tape # record #": printsc$:gosub2600
2440 w=1: print"[158]";: fori=1tonr:printleft$(ic$(i),l(10));tab(20)mid$(ic$(i),4)
2450 gosub6600:next:poke198,0:return
2600 gosub2620:print"[154]"t$
2610 print"******"tab(20)"*******": print: return
2620 print "[155]there are "nr"[157][146][155] records in file": print: return
2700 print "[145][145][145][145][145][145][155]enter record #:";
2710 gosub 9500: rem *** get kbd input ***
2720 s=val(t$): return
3000 rem *********
3002 rem display record
3004 rem *********
3010 printc1$"[147]display record #"ch: printls$:r1$="":r2$=""
3020 rc=ch:gosub22000:rc$=r1$+r2$
3040 x=4: gosub 180
3042 for z=1 to nf: if z=3 then print
3045 kk$(z)=mid$(rc$,s(z),l(z)): rem *** temporarily saves fields ***
3050 print"[153]"f$(z);": [155]";tab(12);kk$(z)
3060 next: print: if mo<>1 then return
3070 print: print"[155] press any key to continue "
3080 poke 198,0: wait 198,1: poke 198,0: return
3996 rem **********
3997 rem add record
3998 rem **********
3999 :
4000 print"[147] [159] add record ": cr=nr+1: rc$="": print
4020 print "[155] entries for record number"cr":"
4030 print: print: for i=1 to nf: temp$(i)=""
4040 if i<>10 then 4046
4042 print"[155]tape #? 000[157][157][157][150]";
4044 gosub 9000: if t$="" then temp$(i)="000": goto 4055
4045 goto 4050
4046 print"[155]"f$(i)"?"
4048 print"[145][150]";: gosub 9000: if t$="" then goto 4048
4050 temp$(i)=left$(t$+sp$,l(i))
4055 rc$=rc$+temp$(i): next: print
4060 print"[147]": print"[147] [159] add record ": print
4065 gosub 3040: print
4070 print" ok? < y or n >[157][157]